package libnetdb.dm.assoc.base;

import java.io.IOException;

/**
 * The <code>AROutput</code> defines of a general output interface
 * for association rule mining algorithm. It defines two basic
 * operations, i.e., set the number of transactions <code>
 * setTransactionNumber(int)</code> and <code>
 * writeLitemset(Litemset)</code>. These two call-back function will
 * be invoked by the mining algorithm.
 *
 * @author Cheng-Ru Lin
 * @version 1.0
 */
public interface AROutput {

    
    /**
     * Invoked immedately after the mining process started. Sets the
     * support of this mining.
     *
     * @param support the value of support in this mining
     */
    public void setSupport(double support) throws IOException;

    /**
     * Invoked when the miner has read the whole transaction
     * database and realize the total number of transactions.
     * It will be tell the number of transactions of the database.
     *
     * @param num the number of transactions in database
     */
    public void setTransactionNumber(int num) throws IOException;

    /**
     * Invoked when the miner has recognized one new large itemset.
     * One can obtain the found large itemset by this function.
     *
     * @param litemset the recognized large itemset
     */
    public void writeLitemset(Litemset litemset) throws IOException;

    public void open() throws IOException;
    public void close() throws IOException;   
    
}